/* ================================
   通用卡片样式 - 适用于所有菜单的卡片
   ================================ */
.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 255, 0.9) 100%);
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
  transition: var(--transition-base);
  margin-bottom: 24px;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.card-header {
  background: linear-gradient(135deg, var(--bg-white) 0%, var(--gray-50) 100%);
  color: var(--text-primary);
  border: none;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  font-weight: 600;
  font-size: 16px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

/* 不同功能模块的主题色 */
#accounts-section .card-header {
  background: linear-gradient(135deg, rgba(82, 196, 26, 0.05) 0%, rgba(115, 209, 61, 0.02) 100%);
}

#accounts-section .card-header::before {
  background: linear-gradient(90deg, var(--success-color), var(--success-hover));
}

#items-section .card-header {
  background: linear-gradient(135deg, rgba(250, 173, 20, 0.05) 0%, rgba(255, 197, 61, 0.02) 100%);
}

#items-section .card-header::before {
  background: linear-gradient(90deg, var(--warning-color), var(--warning-hover));
}

#auto-reply-section .card-header,
#keyword-library-section .card-header,
#global-keywords-section .card-header {
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.05) 0%, rgba(64, 169, 255, 0.02) 100%);
}

#auto-reply-section .card-header::before,
#keyword-library-section .card-header::before,
#global-keywords-section .card-header::before {
  background: linear-gradient(90deg, var(--info-color), var(--info-hover));
}

#cards-section .card-header,
#auto-delivery-section .card-header {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.05) 0%, rgba(147, 51, 234, 0.02) 100%);
}

#cards-section .card-header::before,
#auto-delivery-section .card-header::before {
  background: linear-gradient(90deg, #8a2be2, #9333ea);
}

#notification-channels-section .card-header,
#message-notifications-section .card-header {
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.05) 0%, rgba(255, 120, 117, 0.02) 100%);
}

#notification-channels-section .card-header::before,
#message-notifications-section .card-header::before {
  background: linear-gradient(90deg, var(--danger-color), var(--danger-hover));
}

#logs-section .card-header {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.05) 0%, rgba(156, 163, 175, 0.02) 100%);
}

#logs-section .card-header::before {
  background: linear-gradient(90deg, var(--gray-600), var(--gray-500));
}

#system-settings-section .card-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(129, 140, 248, 0.02) 100%);
}

#system-settings-section .card-header::before {
  background: linear-gradient(90deg, #6366f1, #818cf8);
}

#about-section .card-header {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(74, 222, 128, 0.02) 100%);
}

#about-section .card-header::before {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.card-header h5, .card-header h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

.card-footer {
  background: var(--bg-gray);
  border-top: 1px solid var(--border-light);
  padding: 16px 24px;
}

/* ================================
   按钮样式优化 - 增加渐变和阴影效果
   ================================ */
.btn {
  border-radius: var(--radius-base);
  font-weight: 500;
  transition: var(--transition-base);
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: #667eea;
  color: var(--text-white);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  border-color: #764ba2;
  color: var(--text-white);
  box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), var(--success-hover));
  border-color: var(--success-color);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--success-hover), var(--success-light));
  border-color: var(--success-hover);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), var(--danger-hover));
  border-color: var(--danger-color);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-hover), var(--danger-light));
  border-color: var(--danger-hover);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), var(--warning-hover));
  border-color: var(--warning-color);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(250, 173, 20, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, var(--warning-hover), var(--warning-light));
  border-color: var(--warning-hover);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(250, 173, 20, 0.4);
}

.btn-info {
  background: linear-gradient(135deg, var(--info-color), var(--info-hover));
  border-color: var(--info-color);
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.btn-info:hover {
  background: linear-gradient(135deg, var(--info-hover), var(--info-light));
  border-color: var(--info-hover);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  border-color: var(--border-color);
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
  border-color: var(--gray-300);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: linear-gradient(135deg, rgba(22, 119, 255, 0.05), transparent);
  box-shadow: inset 0 1px 0 rgba(22, 119, 255, 0.1);
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border-color: var(--primary-color);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.4);
}

.btn-outline-success {
  border-color: var(--success-color);
  color: var(--success-color);
  background: linear-gradient(135deg, rgba(82, 196, 26, 0.05), transparent);
  box-shadow: inset 0 1px 0 rgba(82, 196, 26, 0.1);
}

.btn-outline-success:hover {
  background: linear-gradient(135deg, var(--success-color), var(--success-hover));
  border-color: var(--success-color);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}

.btn-outline-info {
  border-color: var(--info-color);
  color: var(--info-color);
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.05), transparent);
  box-shadow: inset 0 1px 0 rgba(24, 144, 255, 0.1);
}

.btn-outline-info:hover {
  background: linear-gradient(135deg, var(--info-color), var(--info-hover));
  border-color: var(--info-color);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.btn-outline-danger {
  border-color: var(--danger-color);
  color: var(--danger-color);
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.05), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 77, 79, 0.1);
}

.btn-outline-danger:hover {
  background: linear-gradient(135deg, var(--danger-color), var(--danger-hover));
  border-color: var(--danger-color);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
}

.btn-outline-warning {
  border-color: var(--warning-color);
  color: var(--warning-color);
  background: linear-gradient(135deg, rgba(250, 173, 20, 0.05), transparent);
  box-shadow: inset 0 1px 0 rgba(250, 173, 20, 0.1);
}

.btn-outline-warning:hover {
  background: linear-gradient(135deg, var(--warning-color), var(--warning-hover));
  border-color: var(--warning-color);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(250, 173, 20, 0.4);
}

.btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-secondary);
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.03), transparent);
  box-shadow: inset 0 1px 0 rgba(156, 163, 175, 0.1);
}

.btn-outline-secondary:hover {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  border-color: var(--gray-300);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  min-height: 28px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  min-height: 40px;
}

/* ================================
   通用表格样式 - 适用于所有菜单的表格
   ================================ */
.table {
  margin-bottom: 0;
  background: transparent;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  border-top: none;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-gray);
  padding: 12px 16px;
  font-size: 14px;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 14px;
}

.table tbody tr {
  transition: var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-gray);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-responsive {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

/* ================================
   徽章和标签样式
   ================================ */
.badge {
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge.bg-primary {
  background: var(--primary-color) !important;
  color: var(--text-white);
}

.badge.bg-success {
  background: var(--success-color) !important;
  color: var(--text-white);
}

.badge.bg-danger {
  background: var(--danger-color) !important;
  color: var(--text-white);
}

.badge.bg-warning {
  background: var(--warning-color) !important;
  color: var(--text-white);
}

.badge.bg-info {
  background: var(--info-color) !important;
  color: var(--text-white);
}

.badge.bg-secondary {
  background: var(--gray-500) !important;
  color: var(--text-white);
}

/* ================================
   表单控件样式
   ================================ */
.form-control, .form-select {
  border-radius: var(--radius-base);
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5715;
  color: var(--text-primary);
  background: var(--bg-white);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-bg);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-text {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 4px;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-bg);
}

/* ================================
   其他通用样式
   ================================ */
.cookie-value {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
  font-size: 13px;
  background: var(--bg-gray);
  padding: 12px;
  border-radius: var(--radius-base);
  border: 1px solid var(--border-light);
  word-break: break-all;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 32px;
  height: 32px;
}

.keyword-editor {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}

.modal-content {
  border-radius: var(--radius-xl);
  border: none;
  box-shadow: var(--shadow-6);
}

.modal-header {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-white);
  color: var(--text-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 24px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-gray);
  padding: 16px 24px;
}

.cookie-id {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 48px 32px;
  color: var(--text-secondary);
}

.empty-state i {
  opacity: 0.6;
  color: var(--text-tertiary);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.toast {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-4);
  backdrop-filter: blur(8px);
}

.btn-group .btn {
  margin-right: 8px;
}

.btn-group .btn:last-child {
  margin-right: 0;
}

/* ================================
   响应式设计
   ================================ */
@media (max-width: 768px) {
  .card-body {
    padding: 16px;
  }
  
  .card-header {
    padding: 16px;
    font-size: 14px;
  }
  
  .card-footer {
    padding: 12px 16px;
  }

  .btn {
    font-size: 13px;
    padding: 6px 12px;
    min-height: 28px;
  }

  .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-height: 24px;
  }

  .cookie-value {
    font-size: 12px;
    max-height: 80px;
    padding: 8px;
  }

  .btn-group {
    flex-direction: column;
    gap: 4px;
  }

  .btn-group .btn {
    margin-right: 0;
    width: 100%;
  }

  .table th,
  .table td {
    padding: 8px 12px;
    font-size: 13px;
  }

  .modal-header {
    padding: 16px;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    padding: 12px 16px;
  }

  .empty-state {
    padding: 32px 16px;
  }
}

/* ================================
   订单管理优化样式
   ================================ */
#orders-section .alert {
  margin-bottom: 0.75rem;
  padding: 0.5rem 1rem;
}

#orders-section .alert .small {
  margin-bottom: 0;
}

/* 订单统计卡片优化 */
#orders-section .row .card {
  transition: all 0.3s ease;
  border: none;
  height: 100%;
}

#orders-section .row .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

#orders-section .card-body.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

/* 订单表格优化 */
#orders-section .table-responsive {
  max-height: 70vh;
  overflow-y: auto;
}

#orders-section .table th {
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 10;
  font-size: 13px;
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
}

#orders-section .table td {
  padding: 0.75rem 0.5rem;
  font-size: 13px;
  vertical-align: middle;
}

/* 搜索筛选区域优化 */
#orders-section .card-body {
  padding: 1rem 1.5rem;
}

#orders-section .form-control, 
#orders-section .form-select {
  font-size: 13px;
  padding: 0.5rem 0.75rem;
}

#orders-section .btn-sm {
  font-size: 12px;
  padding: 0.375rem 0.75rem;
}

/* 分页控件优化 */
#orders-section .card-footer {
  padding: 0.75rem 1.5rem;
  background: var(--bg-gray);
}

/* 响应式优化 */
@media (max-width: 1200px) {
  #orders-section .row .card-body h4 {
    font-size: 1.1rem;
  }
  
  #orders-section .row .card-body .small {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  #orders-section .row .card-body {
    padding: 0.75rem !important;
  }
  
  #orders-section .row .card-body h4 {
    font-size: 1rem;
  }
  
  #orders-section .table th,
  #orders-section .table td {
    padding: 0.5rem 0.25rem;
    font-size: 12px;
  }
  
  #orders-section .card-body {
    padding: 0.75rem 1rem;
  }
}
